home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / you-075a.lha / you-075a / global.h < prev    next >
C/C++ Source or Header  |  1992-06-18  |  8KB  |  279 lines

  1. /* ******************************************************************** */
  2. /*  global.h         Copyright (C) Codemist and University of Bath 1989 */
  3. /*                                                                      */
  4. /* Global variables                                            */
  5. /* ******************************************************************** */
  6.  
  7. /*
  8.  * $Id: global.h,v 1.11 1992/06/18 19:36:19 pab Exp $
  9.  *
  10.  * $Log: global.h,v $
  11.  * Revision 1.11  1992/06/18  19:36:19  pab
  12.  * Tidied up relics
  13.  *
  14.  * Revision 1.10  1992/04/27  21:56:27  pab
  15.  * changed malloc decl
  16.  *
  17.  * Revision 1.9  1992/04/26  21:01:22  pab
  18.  * definition of add_root and allocate_static_vector
  19.  *
  20.  * Revision 1.8  1992/02/27  15:48:17  pab
  21.  * lose alloc_condition
  22.  *
  23.  * Revision 1.7  1992/02/10  12:08:45  pab
  24.  * macroised allocate_integer
  25.  *
  26.  * Revision 1.6  1992/01/29  13:41:50  pab
  27.  * sysV fixes
  28.  *
  29.  * Revision 1.5  1992/01/10  15:17:56  pab
  30.  * changed allocate_integer for fixnums
  31.  *
  32.  * Revision 1.4  1991/12/22  15:14:11  pab
  33.  * Xmas revision
  34.  *
  35.  * Revision 1.3  1991/11/15  13:44:52  pab
  36.  * copyalloc rev 0.01
  37.  *
  38.  * Revision 1.2  1991/09/11  12:07:16  pab
  39.  * 11/9/91 First Alpha release of modified system
  40.  *
  41.  * Revision 1.1  1991/08/12  16:49:39  pab
  42.  * Initial revision
  43.  *
  44.  * Revision 1.7  1991/05/16  11:23:16  pab
  45.  * 'C' garbage collector support
  46.  *
  47.  * Revision 1.5  1991/02/13  18:21:16  kjp
  48.  * New class declarations.
  49.  *
  50.  */
  51.  
  52. /*
  53.  * Change Log:
  54.  *   Version 1, April 1989
  55.  *     Reserved slot declarations and make_special_symbol prototype
  56.  */
  57.  
  58. #ifndef GLOBAL_H
  59. #define GLOBAL_H
  60.  
  61. #include <stdio.h>
  62. #ifndef SETJMP_H
  63. #define SETJMP_H
  64. #include <setjmp.h>
  65. #endif
  66.  
  67. #ifdef WITH_BIGNUMS
  68. extern void initialise_bignums(void);
  69. extern LispObject Big_Integer;
  70. #endif
  71.  
  72. extern LispObject ObList;
  73.  
  74. extern LispObject Object;
  75. extern LispObject nil;
  76. extern LispObject lisptrue;
  77. extern LispObject unbound;
  78.  
  79. /* Meta classes */
  80.  
  81.  
  82. extern LispObject Object;
  83. extern LispObject  Standard_Class;
  84. extern LispObject   Slot_Description_Class;
  85. extern LispObject     Slot_Description;
  86. extern LispObject      Local_Slot_Description;
  87.  
  88. extern LispObject Abstract_Class;
  89.  
  90. /* Allocation specifying metaclasses */
  91.  
  92. extern LispObject Structure_Class;                /* Like to C structs */
  93. extern LispObject Funcallable_Object_Class;       /* Function forms */
  94. extern LispObject Generic_Class;
  95. extern LispObject Pair_Class;
  96. extern LispObject Unpredictable_Fixed_Size_Class; /* Vector-type things */
  97. extern LispObject Variable_Size_Keyed_Class;      /* Tabular instances */
  98. extern LispObject Thread_Class;
  99. extern LispObject Method_Class;
  100.  
  101. /* The core building blocks */
  102.  
  103. extern LispObject Abstract_Class; /* Meta */
  104. extern LispObject Number, Complex, Real, Rational, Integer;
  105. extern LispObject Symbol, Character, String;
  106. extern LispObject Thread, Continue;
  107. extern LispObject Function, Generic, Method;
  108.  
  109. /* Composites */
  110.  
  111. extern LispObject Cons, Vector, Table, Null;
  112.  
  113. /* Pointer */
  114.  
  115. extern LispObject Weak_Wrapper;
  116.  
  117. /* KJP prototypes */
  118.  
  119. extern LispObject Slot_Initarg;
  120. extern LispObject Default_Initargs;
  121.  
  122. extern LispObject Object_Class;     /* Reserved slot symbols */
  123. extern LispObject Class_Name;
  124. extern LispObject Class_Parent;
  125. extern LispObject Class_Children;
  126. extern LispObject Class_Instance_Description;
  127.  
  128. extern LispObject Slot_Class; /* A slot option */
  129.  
  130. extern LispObject Slot_Name;                    /* Slot descriptor fields */
  131. extern LispObject Slot_Position;
  132. extern LispObject Slot_Reader;
  133. extern LispObject Slot_Writer;
  134. extern LispObject Slot_Initform;  /* Local */
  135. extern LispObject Slot_Value;     /* Shared */
  136.  
  137. extern void make_special_symbol(LispObject*, LispObject *, char * );
  138.  
  139. extern void put_table( LispObject, LispObject );
  140.  
  141. extern void bootstrap(LispObject*);
  142. extern LispObject Fn_plus(LispObject*);
  143. extern LispObject Fn_difference(LispObject*);
  144.  
  145. /* Vectors */
  146.  
  147. extern void initialise_vectors(LispObject* );
  148.  
  149. /* Others I needed prototypes for */
  150.  
  151. EUDECL(Fn_symbolvalue);
  152.  
  153. /* KJP def end */
  154.  
  155. extern LispObject q_eof;
  156.  
  157. int add_root(LispObject *);
  158. EUDECL( Fn_cons);
  159. extern LispObject allocate_symbol(LispObject*,char *);
  160. extern LispObject get_symbol(LispObject*,char *); /* Use this one */
  161. extern LispObject allocate_table(LispObject*,LispObject (*)(LispObject*));
  162. LispObject allocate_vector(LispObject *,int);
  163. LispObject allocate_static_vector(LispObject *,int);
  164. extern LispObject allocate_function(int,LispObject(*)(), int, LispObject);
  165.  
  166. extern LispObject Fn_eq(LispObject*);
  167. extern LispObject Fn_equal(LispObject*);
  168. extern LispObject Fn_read(LispObject*);
  169. extern LispObject Fn_prin(LispObject*);
  170. extern LispObject Fn_print(LispObject*);
  171. extern LispObject Fn_nreverse(LispObject*);
  172. extern LispObject Fn_make_table(LispObject*);
  173. extern LispObject Fn_tref(LispObject*);
  174. extern LispObject tref_updator(LispObject*);
  175. extern LispObject table_copy(LispObject*);
  176. extern LispObject Fn_length(LispObject*);
  177.  
  178. extern LispObject allocate_char(LispObject*,char);
  179. extern LispObject allocate_stream(LispObject*,FILE*, int);
  180. extern LispObject allocate_string(LispObject*,char *,int);
  181.  
  182.  
  183. #ifdef NOLOWTAGINTS
  184. #define STATIC_INTEGERS 1024
  185. extern LispObject static_ints;
  186.  
  187. extern LispObject real_allocate_integer(LispObject*, int);
  188. #define allocate_integer(stacktop,x) \
  189.   ((x>=0 && x<STATIC_INTEGERS) ? vref(static_ints,x) : real_allocate_integer(stacktop,x))
  190.     
  191. #else
  192. #define allocate_integer(waste,x) (mk_fixnum(x))
  193. #endif
  194. extern LispObject allocate_ratio(LispObject*,LispObject, LispObject);
  195. extern LispObject allocate_float(LispObject*,double);
  196. extern LispObject allocate_complex(LispObject*,LispObject, LispObject);
  197. extern LispObject allocate_continue(LispObject*);
  198. extern LispObject allocate_thread(LispObject*,int, int, int);
  199. extern LispObject allocate_module(LispObject*,LispObject, Env, LispObject);
  200. extern LispObject make_module_function(LispObject*,
  201.                        char *, LispObject(*)(), int);
  202. extern LispObject make_special(char *, LispObject(*)());
  203. extern LispObject allocate_env(LispObject*,LispObject, LispObject, LispObject);
  204. extern LispObject allocate_envimut(LispObject*,
  205.                    LispObject, LispObject, LispObject);
  206.  
  207. extern LispObject allocate_condition_class(LispObject*,int, LispObject, 
  208.                        LispObject, LispObject);
  209. extern LispObject allocate_class(LispObject*,LispObject);
  210. extern LispObject allocate_instance(LispObject*,LispObject);
  211.  
  212. extern LispObject Fn_set(LispObject*);
  213. extern void set_associate(LispObject*,LispObject, LispObject);
  214. extern void set_anon_associate(LispObject*,LispObject, LispObject);
  215.  
  216. extern void initialise_input(LispObject*);
  217. extern void re_initialise_input(void);
  218. extern LispObject sym_quote;
  219. extern LispObject sym_quasiquote;
  220. extern LispObject sym_unquote;
  221. extern LispObject sym_progn;
  222. extern LispObject sym_defun;
  223. extern LispObject sym_defglobal;
  224. extern LispObject sym_setq;
  225.  
  226. extern void initialise_output(LispObject*);
  227. extern void initialise_eval(void);
  228. extern LispObject sym_lambda;
  229. extern void initialise_basic(LispObject*);
  230. extern void initialise_generics(LispObject*);
  231. extern void initialise_chars(LispObject*);
  232. extern void initialise_streams(LispObject*);
  233. extern void initialise_tables(LispObject*);
  234. extern void initialise_set(LispObject*);
  235. extern void initialise_error(LispObject*);
  236. extern void initialise_arith(LispObject*);
  237. extern void initialise_threads(LispObject*);
  238. extern void initialise_modules(LispObject*);
  239. extern void initialise_classes(LispObject*);
  240. extern void initialise_bit_vectors(LispObject *);
  241. extern LispObject sym_handler, sym_accept, sym_decline;
  242. extern LispObject sym_dynamic;
  243. extern LispObject sym_dynamic_let;
  244. extern LispObject sym_table_copy;
  245.  
  246. extern LispObject StdIn;
  247. extern LispObject StdOut;
  248. extern LispObject StdErr;
  249.  
  250. extern LispObject Gf_generic_prin(LispObject *);
  251.  
  252. #ifdef CGC
  253. #define malloc gc_malloc
  254. #endif
  255.  
  256. #ifdef xxx
  257. #ifdef __STDC__
  258. extern void *malloc(int); /* not size_t yet */
  259. #else
  260. extern char* malloc(int);
  261. #endif
  262. #endif
  263. extern void exit(int);
  264.  
  265. /*
  266.  * Globally used thread information... 
  267.  */
  268.  
  269. #include "state.h"
  270.  
  271. #define STACK(x) 0
  272. #define UNSTACK(n) 0
  273.  
  274. #define N_SLOTS_IN_STRUCT(x) \
  275.   (((sizeof(x))-sizeof(Object_t))/sizeof(LispObject))
  276.  
  277. #endif /* GLOBAL_H */
  278. /* End of global.h */
  279.